package org.example.baseinfo.exception;


import org.example.baseinfo.common.vo.IError;

public class EmptyListException extends RuntimeException {

    private static final long serialVersionUID = 1701184367895371477L;
    /**
     * 错误码
     */
    private final String errorCode;

    private final boolean page;

    public EmptyListException() {
        this.errorCode = null;
        this.page = false;
    }

    public EmptyListException(boolean page) {
        this.errorCode = null;
        this.page = page;
    }

    public EmptyListException(String errorMsg) {
        super(errorMsg);
        this.errorCode = null;
        this.page = false;
    }

    public EmptyListException(IError iError) {
        super(iError.getMsg());
        this.errorCode = iError.getCode();
        this.page = false;
    }

    public EmptyListException(String errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.page = false;
    }

    public EmptyListException(String errorCode, Throwable error) {
        super(error);
        this.errorCode = errorCode;
        this.page = false;
    }

    public EmptyListException(String errorCode, String errorMsg, Throwable error) {
        super(errorMsg, error);
        this.errorCode = errorCode;
        this.page = false;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public boolean isPage() {
        return page;
    }
}

